<template lang="">
    <div>
        分类展示: <br/><br/>
        <ul>
            <li v-for='i in list'>{{i.name}}{{i.tname}}</li>
        </ul>
        <pages :total='total' @currentP='getCurrent'/>
    </div>
</template>
<script>
import pages from './pages'
export default {
    components:{
        'pages':pages
    },
    data(){
        return{
            list:[],
            total:0,
            page:1
        }
    },
    methods: {
        getlist(){
            this.$axios.get('pagecates?page='+this.page).then(res=>{
                this.list = res.data.list
                this.total = res.data.total
            })
        },
        getCurrent(v){
            this.page = v
            this.getlist()
        }
    },
    mounted() {
        this.getlist()
    },
}
</script>
<style lang="">
    
</style>